package principle;

class Father {
    public void fn() throws ClassNotFoundException {
        Class.forName("com.test.Father");
    }
}

class Son extends Father {
    /*
    @Override
    public void fn() throws Exception {  //错误，方法重写时子类不能比父类更大的异常
        super.fn();
    }*/

    //子类可以抛出与父类相同的异常或者是父类异常的子类。
    @Override
    public void fn() throws ClassNotFoundException {
        super.fn();
    }
}

public class OverrideExceptionDemo {

    public static void main(String[] args) {

    }
}
